//
//  RCTicketOrderCells.m
//  RocketProject
//
//  Created by chen jiedan on 13-9-8.
//  Copyright (c) 2013年 Rocket. All rights reserved.
//

#import "RCTicketOrderCells.h"
#import "CommonDefines.h"
#import "UIColor-Expanded.h"
#import "TTTAttributedLabel.h"
#import "RCTranlistDataModel.h"
#import "RCTrainOrderDetailInfoDataModel.h"

#define kLineImageFile          @"image_line_type3.png"
#define kBGImageFile            @"image_discount_cell_bg.png"
#define kArrowImageFile         @"flyTicket_orderCell_arrow.png"


@implementation RCTicketOrderTimeHeaderCell {
    UIImageView *_bgGroundView;
    UIImageView *_typeImageView;
    
    UILabel *_startTime;
    UILabel *_trafficTypeLabel;
    UILabel *_trafficCodeLabel;
    UIImageView *_lineImageView;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        
        UIImage *bgImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kBGImageFile ofType:nil]];
        [self setBackgroundColorWithImage:bgImage];
        self.backgroundColor = [UIColor clearColor];
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    _bgGroundView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 13, 292, 35)];
    [self.contentView addSubview:_bgGroundView];
    _bgGroundView.image = [UIImage imageNamed:@"icon_ticketType_bg"];
    [_bgGroundView release];
    
    _typeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(32, 23, 16, 14)];
    [self.contentView addSubview:_typeImageView];
    _typeImageView.image = [UIImage imageNamed:@"icon_ticketType_train_white"];
    [_typeImageView release];
    
    _startTime = [[UILabel alloc] initWithFrame:CGRectMake(65, 23, 155, 15)];
    _startTime.font = [UIFont fontWithName:kFontNameHelvetica size:15];
    _startTime.backgroundColor = [UIColor clearColor];
    _startTime.textColor = [UIColor whiteColor];
    [self.contentView addSubview:_startTime];
    [_startTime release];
    
    
    _trafficTypeLabel = [[UILabel alloc] initWithFrame:CGRectMake(33, 56, 70, 14)];
    _trafficTypeLabel.font = [UIFont fontWithName:kFontNameHeiti size:14];
    _trafficTypeLabel.backgroundColor = [UIColor clearColor];
    _trafficTypeLabel.textColor = [UIColor colorWithHex:0xff333333];
    [self.contentView addSubview:_trafficTypeLabel];
    [_trafficTypeLabel release];
    
    
    _trafficCodeLabel = [[UILabel alloc] initWithFrame:CGRectMake(108, 56,100, 14)];
    _trafficCodeLabel.font = [UIFont fontWithName:kFontNameHeiti size:14];
    _trafficCodeLabel.backgroundColor = [UIColor clearColor];
    _trafficCodeLabel.textColor = [UIColor colorWithHex:0xff0e5eb7];
    [self.contentView addSubview:_trafficCodeLabel];
    [_trafficCodeLabel release];
    
    _lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 78, 320, 1)];
    _lineImageView.backgroundColor = [UIColor clearColor];
    [_lineImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLineImageFile ofType:nil]]];
    [self.contentView addSubview:_lineImageView];
    [_lineImageView release];
    
    
}


- (void) bindData:(RCTrainItemDataModel *)dataModel withTimeString:(NSString *)timeString
{
    
    if (nil == dataModel) {
        return;
    }
    _startTime.text = timeString;
    _trafficTypeLabel.text = dataModel.trainname;
    _trafficCodeLabel.text = dataModel.traincode;
    
}

+(CGFloat)getCellHeight{
    return 79;
}

@end



@implementation RCTicketTimePriceDetailCell{
    UILabel *_startTime;
    UILabel *_endTime;
    
    UIImageView *startAddIMG;
    UILabel *_startAddr;
    UIImageView *endAddIMG;
    UILabel *_endAddr;
    
    UILabel *_priceLabel;
    UILabel *_priceLabelContent;
    
    UILabel *_orginPriceLabel;
    UILabel *_orginPriceLabelContent;
    
    UILabel *_feeLabel;
    UILabel *_feeLabelContent;
    UIImageView *_lineImageView;
    
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        UIImage *bgImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kBGImageFile ofType:nil]];
        [self setBackgroundColorWithImage:bgImage];
        self.backgroundColor = [UIColor clearColor];
        
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    //出发时间
    _startTime = [[UILabel alloc] initWithFrame:CGRectMake(33, 8, 70, 14)];
    _startTime.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _startTime.backgroundColor = [UIColor clearColor];
    _startTime.textColor = [UIColor colorWithHex:0xff333333];
    [self.contentView addSubview:_startTime];
    [_startTime release];
    
    //到达时间
    _endTime = [[UILabel alloc] initWithFrame:CGRectMake(33, 30, 60, 12)];
    _endTime.font = [UIFont fontWithName:kFontNameHelvetica size:12];
    _endTime.backgroundColor = [UIColor clearColor];
    _endTime.textColor = [UIColor colorWithHex:0xff333333];
    [self.contentView addSubview:_endTime];
    [_endTime release];
    
    startAddIMG = [[UIImageView alloc] initWithFrame:CGRectMake(108, 10, 12, 12)];
    startAddIMG.image = [UIImage imageNamed:@"icon_train_startAddr"];
    [self.contentView addSubview:startAddIMG];
    [startAddIMG release];
    
    //出发地址
    _startAddr = [[UILabel alloc] initWithFrame:CGRectMake(128, 8, 100, 14)];
    _startAddr.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _startAddr.backgroundColor = [UIColor clearColor];
    _startAddr.textColor = kNormalTextColor;
    [self.contentView addSubview:_startAddr];
    [_startAddr release];
    
    endAddIMG = [[UIImageView alloc] initWithFrame:CGRectMake(108, 32, 12, 12)];
    endAddIMG.image = [UIImage imageNamed:@"icon_train_endAddr"];
    [self.contentView addSubview:endAddIMG];
    [endAddIMG release];
    
    //到达地址
    _endAddr = [[UILabel alloc] initWithFrame:CGRectMake(128, 30, 100, 14)];
    _endAddr.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _endAddr.backgroundColor = [UIColor clearColor];
    _endAddr.textColor = kNormalTextColor;
    [self.contentView addSubview:_endAddr];
    [_endAddr release];
    
    
    //价钱
    _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(33, 52, 40, 14)];
    _priceLabel.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _priceLabel.backgroundColor = [UIColor clearColor];
    _priceLabel.textColor = kNormalTextColor;
    _priceLabel.text = @"票价";
    
    CGSize size = [_priceLabel.text sizeWithFont:_priceLabel.font constrainedToSize:CGSizeMake(200, 20)];
    _priceLabel.frame = CGRectMake(33, 52, size.width, 14);
    
    [self.contentView addSubview:_priceLabel];
    [_priceLabel release];
    
    
    CGFloat originX = CGRectGetMaxX(_priceLabel.frame);
    _priceLabelContent = [[UILabel alloc] initWithFrame:CGRectMake(originX, 52, 70, 14)];
    _priceLabelContent.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _priceLabelContent.backgroundColor = [UIColor clearColor];
    _priceLabelContent.textColor = kNormalOrangeTextColor;
    [self.contentView addSubview:_priceLabelContent];
    [_priceLabelContent release];
    
    
    _lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 74, 320, 1)];
    _lineImageView.backgroundColor = [UIColor clearColor];
    [_lineImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLineImageFile ofType:nil]]];
    [self.contentView addSubview:_lineImageView];
    [_lineImageView release];
    
    
}


- (void) bindData:(RCTrainItemDataModel*)dataModel
{
    if (nil == dataModel) {
        return;
    }
    _startTime.text = dataModel.starttime;
    _endTime.text = dataModel.endtime;
    _startAddr.text = dataModel.startcity;
    _endAddr.text = dataModel.endcity;
    
    
    _priceLabelContent.text = [NSString stringWithFormat:@"￥%@",[dataModel.ticketprice stringByReplacingOccurrencesOfString:@"￥" withString:@""]];
    
}

+(CGFloat)getCellHeight{
    return 75.0f;
}




@end


@implementation RCTicketSeatTypeCell{
    UILabel *_leftLabel;
    UILabel *_rigthLabel;
    UIImageView *_arrowImageView;
    UIImageView *_lineImageView;
   
    
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        UIImage *bgImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kBGImageFile ofType:nil]];
        [self setBackgroundColorWithImage:bgImage];
        self.backgroundColor = [UIColor clearColor];
        
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    
    _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(33, 12, 100, 14)];
    _leftLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _leftLabel.backgroundColor = [UIColor clearColor];
    _leftLabel.textColor = kNormalTextColor;
    _leftLabel.text = @"坐席类型";
    [self.contentView addSubview:_leftLabel];
    [_leftLabel release];
    
    _rigthLabel = [[UILabel alloc] initWithFrame:CGRectMake(140, 12, 150, 14)];
    _rigthLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _rigthLabel.backgroundColor = [UIColor clearColor];
    _rigthLabel.textAlignment = UITextAlignmentRight;
    _rigthLabel.textColor = [UIColor colorWithHex:0xff0e5eb7];
    [self.contentView addSubview:_rigthLabel];
    [_rigthLabel release];
    
    _arrowImageView = [[UIImageView alloc]initWithFrame:CGRectMake(296, 13, 10, 12)];
    _arrowImageView.backgroundColor = [UIColor clearColor];
    [_arrowImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kArrowImageFile ofType:nil]]];
    [self.contentView addSubview:_arrowImageView];
    [_arrowImageView release];
    
    _lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 37, 320, 1)];
    _lineImageView.backgroundColor = [UIColor clearColor];
    [_lineImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLineImageFile ofType:nil]]];
    [self.contentView addSubview:_lineImageView];
    [_lineImageView release];
}

- (void) bindData:(RCTrainItemDataModel*)dataModel
{
    if (nil == dataModel) {
        return;
    }
    _rigthLabel.text = dataModel.ticketname;
}

+(CGFloat)getCellHeight{
    return 38;
}


@end



@implementation RCTicketAddUserInfoCell{
    UILabel *_leftLabel;
    UIImageView            *_addUserImageView;
    UILabel     *_addUserCodeLabel;
    UIImageView *_lineImageView;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        UIImage *bgImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kBGImageFile ofType:nil]];
        [self setBackgroundColorWithImage:bgImage];
        self.backgroundColor = [UIColor clearColor];
        
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    UIImageView *leftIMG = [[UIImageView alloc] initWithFrame:CGRectMake(33, 15, 7, 8)];
    [self.contentView addSubview:leftIMG];
    leftIMG.image = [UIImage imageNamed:@"icon_ticketOrder_star"];
    [leftIMG release];  
    
    _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(46, 12, 200, 14)];
    _leftLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _leftLabel.backgroundColor = [UIColor clearColor];
    _leftLabel.textColor = kNormalTextColor;
    _leftLabel.text = @"乘客";
    [self.contentView addSubview:_leftLabel];
    [_leftLabel release];
    
    _addUserImageView = [[UIImageView alloc]initWithFrame:CGRectMake(225, 5, 81, 28)];
    _addUserImageView.backgroundColor = [UIColor clearColor];
    [_addUserImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"flyTicket_formBG_flylabel_down.png" ofType:nil]]];
    
    UIImageView *addIcon = [[UIImageView alloc]initWithFrame:CGRectMake(2, 9, 10, 10)];
    addIcon.backgroundColor = [UIColor clearColor];
    [addIcon setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"flyTicket_orderCell_addUser.png" ofType:nil]]];
    [_addUserImageView addSubview:addIcon];
    [addIcon release];
    
    _addUserCodeLabel = [[UILabel alloc]initWithFrame:CGRectMake(14, 7, 66, 14)];
    _addUserCodeLabel.backgroundColor = [UIColor clearColor];
    _addUserCodeLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _addUserCodeLabel.textColor = kNormalTextColor;
    _addUserCodeLabel.text = @"添加乘客";
    [_addUserImageView addSubview:_addUserCodeLabel];
    [_addUserCodeLabel release];
    
    [self.contentView addSubview:_addUserImageView];
    [_addUserImageView release];
    
    _lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 37, 320, 1)];
    _lineImageView.backgroundColor = [UIColor clearColor];
    [_lineImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLineImageFile ofType:nil]]];
    [self.contentView addSubview:_lineImageView];
    [_lineImageView release];

}

+(CGFloat)getCellHeight{
    return 38;
}

@end

@implementation RCTicketUserInfoCell{
    UILabel *_leftLabel;
    UILabel *_rigthLabel;
    UIImageView *_lineImageView;
    
    
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        UIImage *bgImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kBGImageFile ofType:nil]];
        [self setBackgroundColorWithImage:bgImage];
        self.backgroundColor = [UIColor clearColor];
        
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    
    _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(33, 12, 70, 14)];
    _leftLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _leftLabel.backgroundColor = [UIColor clearColor];
    _leftLabel.textColor = kNormalTextColor;
    [self.contentView addSubview:_leftLabel];
    [_leftLabel release];
    
    _rigthLabel = [[UILabel alloc] initWithFrame:CGRectMake(110, 12, 196, 14)];
    _rigthLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _rigthLabel.backgroundColor = [UIColor clearColor];
    _rigthLabel.textAlignment = UITextAlignmentRight;
    _rigthLabel.textColor = [UIColor colorWithHex:0xff0e5eb7];
    [self.contentView addSubview:_rigthLabel];
    [_rigthLabel release];
    
    
    _lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 37, 320, 1)];
    _lineImageView.backgroundColor = [UIColor clearColor];
    [_lineImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLineImageFile ofType:nil]]];
    [self.contentView addSubview:_lineImageView];
    [_lineImageView release];
}

- (void) bindData:(RCTicketOrderUserInfo*)dataModel
{
    if (nil == dataModel) {
        return;
    }
    _leftLabel.text = dataModel.userName;
    _rigthLabel.text = [NSString stringWithFormat:@"%@：%@",dataModel.userNumType,dataModel.userNum];
}

+(CGFloat)getCellHeight{
    return 38;
}


@end


@implementation RCTicketPhoneInfoCell{
    UILabel *_leftLabel;
    UITextField *_phoneTextField;
    UIImageView *_lineImageView;
}

@synthesize phoneTextField = _phoneTextField;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        UIImage *bgImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kBGImageFile ofType:nil]];
        [self setBackgroundColorWithImage:bgImage];
        self.backgroundColor = [UIColor clearColor];
        
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)dealloc{
    self.phoneTextField = nil;
    [super dealloc];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    UIImageView *leftIMG = [[UIImageView alloc] initWithFrame:CGRectMake(33, 15, 7, 8)];
    [self.contentView addSubview:leftIMG];
    leftIMG.image = [UIImage imageNamed:@"icon_ticketOrder_star"];
    [leftIMG release];
    
    _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(46, 12, 200, 14)];
    _leftLabel.font = [UIFont fontWithName:kFontNameLightHeiti size:14];
    _leftLabel.backgroundColor = [UIColor clearColor];
    _leftLabel.textColor = kNormalTextColor;
    _leftLabel.text = @"联系手机";
    [self.contentView addSubview:_leftLabel];
    [_leftLabel release];
    
    
    _phoneTextField = [[UITextField alloc]initWithFrame:CGRectMake(110, 0, 196, 38)];
    _phoneTextField.backgroundColor = [UIColor clearColor];
    _phoneTextField.delegate = self;
    _phoneTextField.textColor = kNormalTextColor;
    _phoneTextField.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _phoneTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    _phoneTextField.placeholder = @"点击编辑手机号";
    [_phoneTextField setReturnKeyType:UIReturnKeyDone];
    [self.contentView addSubview:_phoneTextField];
    
    
    _lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 37, 320, 1)];
    _lineImageView.backgroundColor = [UIColor clearColor];
    [_lineImageView setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLineImageFile ofType:nil]]];
    [self.contentView addSubview:_lineImageView];
    [_lineImageView release];
    
}

+(CGFloat)getCellHeight{
    return 38;
}

#pragma -mark UITextFeildDelegate

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    if ([string isEqualToString:@"\n"]) {
        [textField resignFirstResponder];
        return NO;
    }
    return YES;
}


@end



@implementation RCTicketTotalPriceCell{
    
    UILabel *_leftLabel;
    UILabel *_rightLabel;
    UIButton *_orderButton;
    
}

@synthesize delegate = _delegate;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        self.backgroundColor = [UIColor clearColor];
        [self createPlaceHolder];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)dealloc{
    self.delegate = nil;
    [super dealloc];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void) createPlaceHolder
{
    _orderButton = [[UIButton alloc]initWithFrame:CGRectMake(14, 50, 292, 36)];
    _orderButton.backgroundColor = [UIColor clearColor];
    UIImage *orderImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"bg_ticketOrder_total.png" ofType:nil]];
    [_orderButton setBackgroundImage:orderImage forState:UIControlStateNormal];
    [_orderButton setBackgroundImage:orderImage forState:UIControlStateHighlighted];
    [_orderButton addTarget:self action:@selector(orderButtonClicked) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:_orderButton];
    [_orderButton release];
    
    _leftLabel = [[UILabel alloc] initWithFrame:CGRectMake(33, 61, 200, 14)];
    _leftLabel.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _leftLabel.backgroundColor = [UIColor clearColor];
    _leftLabel.textColor = [UIColor whiteColor];
    [self.contentView addSubview:_leftLabel];
    [_leftLabel release];
    
    
    
    _rightLabel = [[UILabel alloc] initWithFrame:CGRectMake(260, 61, 40, 14)];
    _rightLabel.font = [UIFont fontWithName:kFontNameHelvetica size:14];
    _rightLabel.backgroundColor = [UIColor clearColor];
    _rightLabel.textColor = [UIColor whiteColor];
    _rightLabel.text = @"预订";
    [self.contentView addSubview:_rightLabel];
    [_rightLabel release];
    
}

+(CGFloat)getCellHeight{
    return 96;
}

- (void) bindData:(RCTrainItemDataModel *)dataModel
{
    
    if (nil == dataModel) {
        return;
    }
    NSString *totalString = [dataModel.ticketprice stringByReplacingOccurrencesOfString:@"￥" withString:@""];
    _leftLabel.text = [NSString stringWithFormat:@"订单总额 ￥%@",totalString];

}

-(void)orderButtonClicked{
    if (_delegate && [_delegate respondsToSelector:@selector(commitOrderButtonClick)]) {
        [_delegate commitOrderButtonClick];
    }
}

@end



